home *** CD-ROM | disk | FTP | other *** search
/ Joystick Magazine 1996 May / cd joy 71No13.iso / pc / demos / eurosoc / source / euro_cmd.cpp < prev    next >
C/C++ Source or Header  |  1996-03-20  |  6KB  |  216 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. #include "defines.h"
  6. #include "data.equ"
  7. #include "3deng.h"
  8. #include "intronet.h"
  9. #include "sos.h"
  10. #include "audio.h"
  11. #include "digi.h"
  12. #include "midi.h"
  13. #include "config.h"
  14. #include "timer.h"
  15. #include "mallocx.h"
  16. #include "unmangle.h"
  17. #include "gamedata.h"
  18.  
  19. #include "eurodefs.h"
  20. #include "euro_fxd.h"
  21. #include "mallocx.h"
  22. #include "euro_sym.h"
  23. #include "euro_def.h"
  24. #include "euro_var.h"
  25. #include "euro_dsk.h"
  26. #include "euro_grf.h"
  27.  
  28. void    EuroHelp();
  29.  
  30. //********************************************************************************************************************************
  31.  
  32. void    ProcessCommandLine(int argc, char **argv)
  33.     {
  34.         char    command[127];
  35.         char    setting[127];
  36.         signed char CommandLineTEAM;
  37.         EUROverbose    =     0;
  38.         EUROconsole    =     0;
  39.         EUROcommOVERIDE    =    128;
  40.         
  41.         for (int i=1; i<argc; i++)
  42. // Inputs...
  43.         {
  44.             strcpy( command, argv[i] );
  45.             strupr( command );            
  46.  
  47.             if ( i < (argc-1) )            
  48.             {
  49.                 strcpy( setting, argv[i+1] );
  50.                 strupr( setting );            
  51.                 setting[3] = 0;            
  52.                 CommandLineTEAM  =   -1;
  53.             
  54.                 if (!strcmp( setting, "BUL"))
  55.                     CommandLineTEAM = Bulgaria;                
  56.                 if (!strcmp( setting, "CRO"))
  57.                     CommandLineTEAM = Croatia;                
  58.                 if (!strcmp( setting, "CZE"))
  59.                     CommandLineTEAM = Czech;                
  60.                 if (!strcmp( setting, "DEN"))
  61.                     CommandLineTEAM = Denmark;                
  62.                 if (!strcmp( setting, "ENG"))
  63.                     CommandLineTEAM = England;                
  64.                 if (!strcmp( setting, "FRA"))
  65.                     CommandLineTEAM = France;                
  66.                 if (!strcmp( setting, "GER"))
  67.                     CommandLineTEAM = Germany;                
  68.                 if (!strcmp( setting, "HOL"))
  69.                     CommandLineTEAM = Holland;                
  70.                 if (!strcmp( setting, "ITA"))
  71.                     CommandLineTEAM = Italy;                
  72.                 if (!strcmp( setting, "POR"))
  73.                     CommandLineTEAM = Portugal;                
  74.                 if (!strcmp( setting, "ROM"))
  75.                     CommandLineTEAM = Romania;                
  76.                 if (!strcmp( setting, "RUS"))
  77.                     CommandLineTEAM = Russia;                
  78.                 if (!strcmp( setting, "SCO"))
  79.                     CommandLineTEAM = Scotland;                
  80.                 if (!strcmp( setting, "SPA"))
  81.                     CommandLineTEAM = Spain;                
  82.                 if (!strcmp( setting, "SWI"))
  83.                     CommandLineTEAM = Switzerland;                
  84.                 if (!strcmp( setting, "TUR"))
  85.                     CommandLineTEAM = Turkey;                
  86.             }
  87.             
  88.             //…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª 
  89.             //∫                           ∫
  90.             //∫     WIREPLAY COMMANDS     ∫
  91.             //∫                           ∫
  92.             //»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº 
  93.  
  94.             if (!strcmp( command, "-WIREPLAY"))
  95.             {
  96.                 printf    ("˛ Attempting WIREPLAY game.\n");
  97.                 EUROgameType    =    EURO_wireplay;
  98.               }
  99.  
  100.             if (!strcmp( command, "-NETWORK"))
  101.             {
  102.                 printf    ("˛ Attempting NETWORK game.\n");
  103.                 EUROgameType    =    EURO_network_game;
  104.               }
  105.  
  106.             if (!strcmp( command, "-FRIENDLY"))
  107.             {
  108.                 printf    ("˛ Attempting FRIENDLY game.\n");
  109.                 EUROgameType    =    EURO_friendly;
  110.               }
  111.  
  112.             if ( EUROgameType == EURO_wireplay )
  113.             {
  114.                 if (!strcmp( command, "-HOME"))
  115.                 {
  116.                      if ( CommandLineTEAM != -1 )
  117.                         EUROteamA = CommandLineTEAM;
  118.                 }                    
  119.  
  120.                 if (!strcmp( command, "-AWAY"))
  121.                 {
  122.                      if ( CommandLineTEAM != -1 )
  123.                         EUROteamB = CommandLineTEAM;
  124.                 }                    
  125.             }
  126.  
  127.             //…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª 
  128.             //∫                           ∫
  129.             //∫      GENERAL COMMANDS     ∫
  130.             //∫                           ∫
  131.             //»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº 
  132.  
  133.             if (!strcmp( command, "-1PLAYER"))
  134.                 EUROnoOfMatchPlyrs = 1;
  135.             if (!strcmp( command, "-2PLAYERS"))
  136.                 EUROnoOfMatchPlyrs = 2;
  137.             if (!strcmp( command, "-3PLAYERS"))
  138.                 EUROnoOfMatchPlyrs = 3;
  139.             if (!strcmp( command, "-4PLAYERS"))
  140.                 EUROnoOfMatchPlyrs = 4;
  141.  
  142.             if ( EUROgameType == EURO_championship )
  143.             {
  144.                 if (!strcmp( command, "-5PLAYER"))
  145.                     EUROnoOfMatchPlyrs = 5;
  146.                 if (!strcmp( command, "-6PLAYERS"))
  147.                     EUROnoOfMatchPlyrs = 6;
  148.                 if (!strcmp( command, "-7PLAYERS"))
  149.                     EUROnoOfMatchPlyrs = 7;
  150.                 if (!strcmp( command, "-8PLAYERS"))
  151.                     EUROnoOfMatchPlyrs = 8;
  152.                 if (!strcmp( command, "-9PLAYER"))
  153.                     EUROnoOfMatchPlyrs = 9;
  154.                 if (!strcmp( command, "-10PLAYERS"))
  155.                     EUROnoOfMatchPlyrs = 10;
  156.                 if (!strcmp( command, "-11PLAYERS"))
  157.                     EUROnoOfMatchPlyrs = 11;
  158.                 if (!strcmp( command, "-12PLAYERS"))
  159.                     EUROnoOfMatchPlyrs = 12;
  160.                 if (!strcmp( command, "-13PLAYER"))
  161.                     EUROnoOfMatchPlyrs = 13;
  162.                 if (!strcmp( command, "-14PLAYERS"))
  163.                     EUROnoOfMatchPlyrs = 14;
  164.                 if (!strcmp( command, "-15PLAYERS"))
  165.                     EUROnoOfMatchPlyrs = 15;
  166.                 if (!strcmp( command, "-16PLAYERS"))
  167.                     EUROnoOfMatchPlyrs = 16;
  168.             }            
  169.  
  170.             if (!strcmp( command, "-GROUPS"))
  171.                 Menu = GROUP_FIXTURES;
  172.             if (!strcmp( command, "-WEMBLEY"))
  173.                 Menu = VENUE_FLYTHRU;
  174.             if (!strcmp( command, "-MODEM"))
  175.                 Menu = MODEM_SETUP;
  176.             if (!strcmp( command, "-SYMBOLS"))
  177.                 EUROsymbol    =     1;
  178.             if (!strcmp( command, "-V1"))
  179.                 EUROverbose    =     1;
  180.             if (!strcmp( command, "-CONSOLE"))
  181.                 EUROconsole    =     1;
  182.  
  183.             if (!strcmp( command, "-COMMTYPE0"))
  184.                 EUROcommOVERIDE    =    0;
  185.             if (!strcmp( command, "-COMMTYPE1"))
  186.                 EUROcommOVERIDE    =    1;
  187.             if (!strcmp( command, "-COMMTYPE2"))
  188.                 EUROcommOVERIDE    =    2;
  189.             if (!strcmp( command, "-COMMTYPE3"))
  190.                 EUROcommOVERIDE    =    3;
  191.             
  192.             if (!strcmp( command, "?"))
  193.                 EuroHelp();
  194.         }
  195.  
  196.         setup.verbose        =    EUROverbose;
  197.  
  198.         if ( EUROverbose != 0 )
  199.         {
  200.             printf    ("˛ Outputting VERBOSE information.\n");
  201.         }
  202.     }
  203.  
  204. //********************************************************************************************************************************
  205.  
  206. void    EuroHelp()
  207.     {
  208.  
  209.     printf    ("  -friendly            Defaults to friendly game on execution.\n");
  210.     printf    ("  -network            Defaults to network game on execution.\n\n");
  211.     printf    ("  -wireplay            Defaults to wireplay game on execution.\n");
  212.  
  213.     }
  214.  
  215. //********************************************************************************************************************************
  216.